// declare function SimpleVue(options: any): any




type Return<T> = T extends (...args: any) => any ? ReturnType<T> : never;

type Computed<T> = {
  [key in keyof T]: Return<T[key]>
};

type SimpleVue<D, M, C> = {
  data(this: {}): D;
  computed: C & ThisType<D & C>;
  methods: M & ThisType<D & Computed<C> & M>
};

declare function SimpleVue<D, M, C>(option: SimpleVue<D, M, C>): D & M & C

// In the example above, the methods object in the argument to makeObject has a contextual type that includes 
// ThisType<D & M> and therefore the type of this in methods within the methods object is 
// { x: number, y: number } & { moveBy(dx: number, dy: number): number }. Notice how the type of the
//  methods property simultaneously is an inference target and a source for the this type in methods.
